package cn.iocoder.yudao.module.system.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
 * 用户活动记录配置属性
 * 
 * @author 系统开发团队
 */
@Data
@Component
@ConfigurationProperties(prefix = "yudao.user-activity")
public class UserActivityProperties {

    /**
     * 是否启用用户活动记录
     */
    private Boolean enable = true;

    /**
     * 需要排除的路径
     */
    private Set<String> excludePaths = new HashSet<>(Arrays.asList(
        "/admin-api/system/captcha/**",
        "/admin-api/infra/file/**",
        "/admin-api/system/auth/logout",
        "/admin-api/system/auth/refresh-token",
        "/admin-api/infra/codegen/**",
        "/admin-api/system/dict-data/**",
        "/admin-api/system/permission/**",
        "/admin-api/system/menu/**",
        "/admin-api/system/role/**",
        "/admin-api/system/user/profile",
        "/admin-api/system/user/update-password",
        "/admin-api/system/user/update-avatar",
        "/admin-api/system/tenant/**",
        "/admin-api/system/sms/**",
        "/admin-api/system/mail/**",
        "/admin-api/system/notify/**",
        "/admin-api/system/oauth2/**",
        "/admin-api/system/social/**",
        "/admin-api/system/logger/**",
        "/admin-api/system/ip/**",
        "/admin-api/system/dept/**",
        "/admin-api/system/post/**",
        "/admin-api/system/notice/**",
        "/admin-api/system/version/**",
        "/admin-api/system/task/**",
        "/admin-api/system/user-activity-stats/**",
        "/admin-api/system/user-behavior-stats/**",
        "/admin-api/system/user-retention/**",
        "/admin-api/system/user-analysis/**",
        "/admin-api/system/user-assets-change/**",
        "/admin-api/system/user-assets-code/**",
        "/admin-api/system/student-dashboard/**",
        "/admin-api/system/teacher-dashboard/**",
        "/admin-api/system/lottery/**",
        "/admin-api/system/pay/**",
        "/admin-api/system/wxlogin/**",
        "/admin-api/system/kuaishou/**",
        "/admin-api/system/gugu/**",
        "/admin-api/system/ai/**",
        "/admin-api/system/conversation/**",
        "/admin-api/system/data/**"
    ));

    /**
     * 需要排除的文件扩展名
     */
    private Set<String> excludeExtensions = new HashSet<>(Arrays.asList(
        ".css", ".js", ".png", ".jpg", ".jpeg", ".gif", ".ico", ".svg", ".woff", ".woff2", ".ttf", ".eot"
    ));

    /**
     * 需要记录的活动类型
     */
    private Set<String> recordTypes = new HashSet<>(Arrays.asList(
        "page_view", "api_call", "feature_use"
    ));
}